package com.npjscg.medicalpro.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.npjscg.medicalpro.controller.dto.BusinessDTO;
import com.npjscg.medicalpro.entity.Business;
import com.npjscg.medicalpro.mapper.BusinessMapper;
import com.npjscg.medicalpro.service.IBusinessService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author raote
 * @since 2022-07-09
 */
@Service
public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, Business> implements IBusinessService {

    @Resource BusinessMapper businessMapper;

    @Resource
    private BcheckServiceImpl bcheckService;

    @Override
    public IPage findAll(Page<BusinessDTO> page, int status) {
        return businessMapper.findAll(page ,status);
    }

    @Override
    public void saveBusiness(Business business) {
        businessMapper.saveBusiness(business);
        bcheckService.addCheck(business);

    }

    @Override
    public IPage findAllForU(Page<Business> page, int id, int status) {

        return businessMapper.findAllForU(page, id, status);
    }


}
